home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / amos / amoslist-1294.lzh / AMOSLIST / text0023.txt < prev    next >
Encoding:
Text File  |  1995-01-03  |  1.7 KB  |  62 lines

  1. On Fri, 2 Dec 1994, Marco Beretta wrote:
  2.  
  3. > >     I haven't test it but I think you can use banks.Say you have a 
  4. > > bank and you want to change its length.Just reserve a new one with 
  5. > > the desirable size and copy the contents of the old, to the new 
  6. > > one.
  7. > >     Example:
  8. > >     During runtime you access Bank No #1
  9. > >         
  10. > >     bnum=1
  11. > >     reserve as work bnum,<size>
  12. > >         .
  13. > >         .
  14. > >         .
  15. > >     reserve as work 999,<new size>
  16. > >     copy bnum to 999 ' I don't remember the command now (I'm at the 
  17. > > Univ.
  18. > >     reserve as work bnum,<new size>
  19. > >     copy 999 to bnum
  20. > Well, about dynamic banks...
  21. > I thought on them for some time and cannot Paul add a 
  22. > Banklenghtadd(bytes) command? I don't know, call it Elbnkadd(number,bytes)
  23. > or better Elbnkadd(number of the bank, position, bytes).
  24. > This will solve many problems.
  25. > Poking directly with the bank's lenght is quite dangerous as you could 
  26. > overlap memory used for something else.
  27. > And copying the bank is quite slow if you have a large bank. 
  28. > Any ideas or comment?
  29.     How about using MakeLib extension (1.6kb) which has some nice mem.
  30.     allocation + list handling routines ??
  31.  
  32.     Like:
  33.  
  34.     BUFFER = Ma Malloc (1024,MEM_PUBLIC)
  35.     if BUFFER
  36.         <Do what ever you want to do for BUFFER (1024 bytes)>
  37.         Ma Free (BUFFER) : Rem Free BUFFER
  38.     End If
  39.  
  40.     You can also forget Ma Free or can use Ma Free All (Which is
  41.     automatically executed when quitting AMOSPro or compiled AMOS
  42.     program)
  43.  
  44.     This is something I call _dynamic_ memory allocationg AMOS banks(tm)
  45.     sucks.
  46.  
  47.     The M.
  48.  
  49. > M&F
  50.  
  51. Marko Turunen                 
  52. Sairaalakatu 9 B 30                   marturun@messi.uku.fi
  53. 70110 Kuopio                  marturun@majakka.uku.fi
  54. P. 971 - 2821 661
  55.  
  56.